package com.lzx.reggie.dto

import com.lzx.reggie.entity.Dish
import com.lzx.reggie.entity.DishFlavor


class DishDto : Dish() {
    //菜品对应的口味数据
     var flavors: List<DishFlavor> = ArrayList()
     var categoryName: String? = null
     var copies: Int? = null

    override fun equals(other: Any?): Boolean {
         if (this === other) return true
         if (other !is DishDto) return false
         if (!super.equals(other)) return false

         if (flavors != other.flavors) return false
         if (categoryName != other.categoryName) return false
         if (copies != other.copies) return false

         return true
     }

     override fun hashCode(): Int {
         var result = super.hashCode()
         result = 31 * result + flavors.hashCode()
         result = 31 * result + (categoryName?.hashCode() ?: 0)
         result = 31 * result + (copies ?: 0)
         return result
     }

     override fun toString(): String {
         return "DishDto(flavors=$flavors, categoryName=$categoryName, copies=$copies)"
     }
}